package com.plant.consult.mapper;

import com.plant.common.domain.User;
import com.plant.common.result.Result;
import com.plant.consult.domain.Consult;
import com.plant.consult.domain.ConsultDetail;
import com.plant.consult.domain.ConsultDetailImg;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ConsultMapper {

    void add(Consult consult);

    List<Consult> list();
    List<Consult> findByUserId(Integer userId);
    @Update("update consult set status = 1 where con_id = #{conId}")
    void updateStatus(Long conId);
    @Update("update consult set money = #{money} where con_id = #{conId}")
    void money(Consult consult);

    List<Consult> oneList(User user);
    Consult findById(Integer id);
    @Update("update consult set status = 2 where con_id = #{conId}")
    void over(Consult consult);
    @Select("select ph_id from consult_record where con_id=#{conId}")
    Integer phId(Consult consult);
    @Update("update user set money = money + #{money} where id = #{id}")
    void userMoneyAdd(Integer id, Double money);

//    List<Consult> replyList(ConsultDetail consultDetail);

//    List<ConsultDetailImg> ImgList();
}
